﻿using System.Configuration;

namespace SimpleORM
{
    public class DataSourceSettings : ConfigurationSection
    {
        #region Ctor

        private const string stringDataSourceSettings = "dataSourceSettings";
        private const string stringDataSources = "dataSources";

        #endregion

        #region Properties

        [ConfigurationProperty(stringDataSources, IsDefaultCollection = true)]
        public DataSourceElementCollection Providers
        {
            get { return (DataSourceElementCollection)this[stringDataSources]; }
        }

        #endregion

        #region Methods

        #region Methods - Static

        public static DataSourceSettings GetContext()
        {
            return ConfigurationManager.GetSection(stringDataSourceSettings) as DataSourceSettings;
        }

        #endregion

        #endregion
    }
}
